
<div class="moduleTopNav clearfix">
	<div class="fl-l">
		<?php $module->printAddLink($lang->get('add-news-cat')); ?>
	</div>
	<div class="fl-r">
		<?php
		/*<input type="text" name="filter" class="fld" /> <input type="submit" value="Filter by keyword" />*/
		?>
	</div>
</div>

<table class="datatable">
	<thead>
		<tr>
			<td>&nbsp;</td>
			<td><?php $module->printSortLink($lang->get('title'), 'title'); ?></td>
			<td><?php $module->printSortLink($lang->get('default'), 'default'); ?></td>
			<td><?php $module->printSortLink($lang->get('author'), 'created_by'); ?></td>
			<td><?php $module->printSortLink($lang->get('time-modified'), 'time_modified'); ?></td>
			<td><?php $module->printSortLink($lang->get('time-created'), 'time_created'); ?></td>
		</tr>
	</thead>
	<tbody>
		<?php
		
		$structure = array('title', 'default', 'author', 'time_modified', 'time_created');
		$module->setStructure($structure);
		
		$res = $module->queryData("SELECT * FROM ".$db->module('news_cat'));
		
		if(mysql_num_rows($res)) {
			while($row = mysql_fetch_array($res)) {
				
				$data = array(	'id'				=> stripslashes($row['id'])
								,'title'			=> stripslashes($row['title'])
								,'default'			=> $bool[$row['default']]
								,'author'			=> $user->authorLink($row['created_by'])
								,'time_modified'	=> $cosa->datetime($row['time_modified'])
								,'time_created'		=> $cosa->datetime($row['time_created'])
								);
				$module->printTableRow($data);
				
			}
		} else {
			$module->printEmptyTableRow($lang->get('no-items-found'));
		}
		
		?>
	</tbody>
</table>
